﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Shlook.Client;
using Shlook.Server;
using Shlook.Common;

namespace Shlook.TestServer
{
    class Program
    {
        static void Main(string[] args)
        {
            ChatConfiguration config = ChatConfiguration.Load();

            ChatService service = new ChatService();
            service.Open(config.ServerURL);

            Console.WriteLine("Press RETURN to exit.");

            //ChatClient client1 = new ChatClient("dina", "Dindush", "Online");
            //client1.Connect(SERVER_URL, "net.tcp://localhost:9091/Client1");

            //client1.MessageArrived += (o, e) => Console.WriteLine("Dina got message '" + e.Message + "' from " + e.From.DisplayName);
            //client1.StatusChanged += (o,e)=>Console.WriteLine("Dina got status change notification: " + e.User.DisplayName + "'s status changed to " + e.User.Status);

            //ChatClient client2 = new ChatClient("sasha", "Sashik", "Away");
            //client2.Connect(SERVER_URL, "net.tcp://localhost:9092/Client2");

            //client2.MessageArrived += (o, e) => Console.WriteLine("Sasha got message '" + e.Message + "' from " + e.From.DisplayName);

            //Console.WriteLine("Connected users:");
            //Array.ForEach(client1.GetUsers(), u => Console.WriteLine(u.DisplayName));

            //client1.SendMessage("sasha", "Hey there hottie!");
            //client2.ChangeStatus("In love");

            //client1.UserRemoved += (o, e) => Console.WriteLine("Dina noticed that " + e.UserId + " has disconnected");

            //client2.Disconnect();

            //Console.WriteLine("Connected users:");
            //Array.ForEach(client1.GetUsers(), u => Console.WriteLine(u.DisplayName));

            Console.ReadLine();

            service.Close();
        }
    }
}
